
<?php

set_include_path('..' . DIRECTORY_SEPARATOR . 'src' . PATH_SEPARATOR . get_include_path());

require "EMS_credentials.class.php";
require "EMS_util.class.php";
require "EMS_api.class.php";

// instantiating EMS_util (for generating an authorized url)
$ems_util = new EMS_util(EMS_credentials::clientID, EMS_credentials::publicID, EMS_credentials::secretKey);

// instantiating EMS_api (for using the high level API)
$ems_api = new EMS_api();

// define the resource
$resource = "/players/audio/flash/playlistDefault/?filter=publish=true&orderBy=publishDate;DESC&maxResults=100";

// Print out the authorized URL for the resource
echo $ems_util->ems_authorized_url($resource, "GET", null, null, 1219478147, null);

// Print out the playlist player
echo $ems_api->get_playlist_player("playlistDefault", null, "publish=true", "publishDate;DESC", 100)->getLastResult();

?>
